<?php

class Default_Admin_GuestbookDeleteAction extends ProjectBaseAction
{
	public function executeRead(AgaviRequestDataHolder $rd)
	{
		$id = $rd->getParameter('gbid');
		$c = new Criteria();
		$c->add(AfgOMCommentPeer::ID,$id);
		$comment = AfgOMCommentPeer::doSelectOne($c);
		
		if($comment instanceof AfgOMComment && $comment->getId()==$id) {
			$comment->delete();
			return 'Success';
		} else {
			return 'Error';
		}
		
	}
	
	public function isSecure()
	{
		return true; 
	}
}

?>